<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>水平对齐</title>
    <style>

        hr{
            background-color: red;
            border: none;
            height: 1px;

        }
        .right{
            width: 300px;
            height: 800px;
            position: absolute;
            background-color: lightyellow;
            right: 0px;

        }

        /*.p1{*/

        /*      width: 200px;*/
        /*      height: 100px;*/
        /*      background-color: red;*/
        /*      position: absolute;*/
        /*      left: 0px;*/
        /*      bottom: 0px;*/

        /*  }*/


    </style>
</head>
<body>
<h2>使用Margin中心对齐</h2>

<div style="width: 40%;height: 200px;margin-left: auto;margin-right: auto;background-color: orange"></div>

<hr>
<h2>使用position定位,设置左右对齐</h2>

    <div class="right">
        <p class="p1">邢伟新邢伟新邢伟新邢伟新邢伟新邢伟新邢伟新邢伟新邢伟新邢伟新邢伟新邢伟新邢伟新邢伟新邢伟新邢伟新邢伟新邢伟新邢伟新邢伟新邢伟新邢伟新</p>

        <p>青岛海关青岛海关青岛海关青岛海关青岛海关青岛海关青岛海关青岛海关青岛海关青岛海关青岛海关青岛海关青岛海关青岛海关青岛海关青岛海关</p>


    </div>



</body>
</html>